package com.jhc.system.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jhc.common.core.exception.ServiceException;
import com.jhc.api.domain.User;
import com.jhc.api.system.service.UserService;
import com.jhc.system.mapper.UserMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

@DubboService
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements UserService{
    @Override
    public User login(String phone, String password) {
        User user = this.baseMapper.login(phone, password);
        if (user == null){
            throw new ServiceException("登陆失败，账号或密码错误");
        }
        return user;
    }

}
